package com.owc.common.sdk.request;

import com.owc.common.sdk.AbstractRequest;
import com.owc.common.sdk.response.CancelOrderResponse;
import lombok.Data;
import org.apache.http.entity.ContentType;

import java.util.Map;

/**
 * @Author xiaom
 * @Date 2020/4/3 18:49
 * @Version 1.0.0
 * @Description <>
 **/
@Data
public class CancelOrderRequest extends AbstractRequest implements Request<CancelOrderResponse> {

    private String txHash;

    @Override
    protected void setUrlParamsMap(Map<String, Object> map) {
        map.put("txHash",txHash);
    }

    @Override
    public String getApiUrl() {
        return super.getBaseUrl() + "/wallet/cancelOrder";
    }

    @Override
    public Class<CancelOrderResponse> getResponseClass() {
        return CancelOrderResponse.class;
    }

    @Override
    public Object getUrlParams() {
        setUrlParamsMap(super.urlParamsMap);
        return super.urlParamsMap;
    }

    @Override
    public ContentType getContentType() {
        return ContentType.create(ContentType.APPLICATION_JSON.getMimeType(),"UTF-8");
    }

    @Override
    public String getMethod() {
        return super.method;
    }
}
